<local:DocumentBase x:Class="WPFExcelReport.YCAFWDPLAN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    FontSize="16" 
                    MinHeight="800"
                    Background="White" 
                    Loaded="Windows_Loaded"
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <db:SETINTEXDB  x:Key="Set4ITX" />
        <db:SETINTEXDB  x:Key="SetTmp" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwMTYPE" Source="{Binding Path=ICC_MTYPE,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwSECTION" Source="{Binding Path=ICC_SECTION,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwXDECK" Source="{Binding Path=ICC_XDECK,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwNCXDECK" Source="{Binding Path=NC_ICC_ABAUFM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwITXXDECK" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwITXSTOCK" Source="{Binding Path=ICC_STOCK,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwITXEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwTMPEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource SetTmp}}" />
        <CollectionViewSource   x:Key="vwITXABPOS" Source="{Binding Path=ABPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwITXAB15" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource Set4ITX}}" />
    </local:DocumentBase.Resources>
    <TabControl>
        <TabItem Header="采购">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                    <RowDefinition Height="*" MinHeight="300"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
                    <WrapPanel Name="zoneCommand" Margin="4,0,51,6" IsEnabled="False" Visibility="Collapsed">
                        <Label Content="{Binding Source={Localization:Translate Word=系统}}" Width="40" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="1" >00</TextBox>
                        <Label Content="{Binding Source={Localization:Translate Word=语言}}" Width="40" Margin="0,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                        <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                        <Label Content="{Binding Source={Localization:Translate Word=用户名}}" Width="60" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                        <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                        <Label Content="{Binding Source={Localization:Translate Word=密码}}" Width="40" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                        <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow" FontSize="18" KeyboardNavigation.TabIndex="1" TabIndex="4" />
                        <Button Content="{Binding Source={Localization:Translate Word=登录}}" Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">

                        </Button>
                        <CheckBox FontSize="14" Content="{Binding Source={Localization:Translate Word=属于评审组}}" Name="IsBelongs2V9"
                              Visibility="Hidden"></CheckBox>
                        <TextBlock FontSize="14" MinWidth="200" Width="Auto" Name="MemberV9" Background="#FF00AF00"
                               Visibility="Hidden"></TextBlock>
                        <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
                    </WrapPanel>
                    <WrapPanel >
                        <Button  Width="40" Height="40"  Click="btnQuery_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Images/Reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=载入}}"></TextBlock>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=类型}}"></TextBlock>
                        <ComboBox Width="80" Name="cbMTYPE"
                          DisplayMemberPath="SDDATEN"
                          SelectedValuePath="SDKEY"
                          SelectionChanged="cbMTYPE_SelectionChanged"
                         ItemsSource="{Binding Source={StaticResource ResourceKey=vwMTYPE}}"  
                          ></ComboBox>
                        <TextBox Name="txtMTYPE" Width="40" Background="Beige" CharacterCasing="Upper" ></TextBox>
                        <TextBlock FontSize="14"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=计划}}" VerticalAlignment="Center"/>
                        <CheckBox Name="ChkPlanMode" VerticalAlignment="Center" IsChecked="True" Background="White">
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock FontSize="14"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=均分}}" VerticalAlignment="Center"/>
                        <CheckBox Name="AutoSplit" IsChecked="True" VerticalAlignment="Center"  IsEnabled="False"
                          Background="White"
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock FontSize="14"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=手工留位}}" VerticalAlignment="Center"/>
                        <CheckBox Name="ChkMatMode" VerticalAlignment="Center" Checked="ChkMatMode_Checked"
                          Background="White"
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock FontSize="14"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=覆盖}}" VerticalAlignment="Center" Background="White"/>
                        <CheckBox Name="ChkOverride" VerticalAlignment="Center" >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock FontSize="14"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=已完成}}" VerticalAlignment="Center"/>
                        <CheckBox Name="ChkPlanned" VerticalAlignment="Center" IsChecked="True" Background="White" >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>  
                        <TextBlock Text="{Binding Source={Localization:Translate Word=可用数量:}}" FontSize="14" Margin="10,0,0,0" ></TextBlock>
                        <TextBlock FontSize="14" Name="SType" Margin="10,0,0,0" Width="40" Background="Yellow"></TextBlock>
                        <TextBlock FontSize="14" Name="SKRS" Margin="10,0,0,0" Width="30" Background="Green"></TextBlock>
                        <TextBlock FontSize="14" Name="SLFD" Margin="10,0,0,0" Width="40" Background="Gray"></TextBlock>
                        <TextBlock FontSize="14"  Name="SPOS" Margin="10,0,0,0" Width="40" Background="Pink"></TextBlock>
                        <TextBlock FontSize="14" Name="SQTY" Margin="10,0,0,0" Width="60" Background="White" Foreground="Red"></TextBlock>
                        <TextBlock FontSize="14" Name="SAID" Margin="10,0,0,0" Width="60" Background="Gray" Visibility="Collapsed"></TextBlock>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=采购单:类型}}"></TextBlock>
                        <ComboBox Name="cmbEKType" Width="Auto" IsEditable="True" Text="XH" >
                            <ComboBoxItem >XH</ComboBoxItem>
                            <ComboBoxItem>PO</ComboBoxItem>
                        </ComboBox>
                        <TextBox Name="cmbKRS"  Width="30">MP</TextBox>
                    </WrapPanel>
                    <WrapPanel> 
                        <Button Name="btnPurchase" Width="30" Height="30"  Click="btnPurchase_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/Add.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=选入}}"></TextBlock>
                        <Button Name="btnRefreshPurchase" Width="30" Height="30"  Click="btnRefreshPurchase_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/refresh.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=检验}}"></TextBlock>
                        <Button Name="btnITXPurchase" Width="30" Height="30"  IsEnabled="False" Click="btnITXPurchase_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/save.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=产生采购}}"></TextBlock>
                        <Button Name="btnDiscard" Width="30" Height="30"  Click="btnDiscard_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/delete.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="撤销"></TextBlock>
                        <Button Content="{Binding Source={Localization:Translate Word=打印}}"  FontSize="18"   BorderBrush="Yellow" Margin="20,0,0,0"  Name="btnPrint" Width="Auto" Click="btnPrint_Click"/>

                        <WrapPanel>
                            <TextBox Background="PaleGreen"  FontSize="18"     Margin="10,0,0,0"  Width="40"  
                                 Text="{Binding EKPAUFPOS, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=供应商}}"></TextBlock>
                            <ComboBox  ItemsSource="{Binding Source={StaticResource ResourceKey=vwLIEFDAT}}"
                            Margin="10,0,0,0"
                               SelectionChanged="ComboBox_SelectionChanged"
                               Background="Gray"  Width="100" 
                               DisplayMemberPath="LSNAME1"
                               IsEditable="True"
                               SelectedValuePath="LSLIEFNR"
                       >
                            </ComboBox>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=数量}}"></TextBlock>
                            <TextBox Background="White"  Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding EKPME1, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                            <WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=价格}}"></TextBlock>
                                <TextBox Background="White"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding EKPPRME, Source={ StaticResource ResourceKey=vwITXEKPOS}, Converter={StaticResource ResourceKey=PreisConverter}}" CharacterCasing="Upper" />
                            </WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=交期}}"></TextBlock>
                            <TextBox Background="White"   Margin="10,0,0,0"  Width="120"  
                                 Text="{Binding EKPLTERM, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" 
                                     />
                            <Button Name="imgneworder" Width="20"    IsEnabled="False" Visibility="Hidden" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/new.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                    </WrapPanel>
                </StackPanel>
                <DockPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="4" LastChildFill="True"> 
                    <Expander DockPanel.Dock="Left"  ExpandDirection="Left" IsExpanded="True" Name="zonePlan" MaxWidth="600" MinWidth="400">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                            </Grid.RowDefinitions>
                            <StackPanel  Grid.Row="0">
                                <WrapPanel   >
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=款式:}}" />
                                    <TextBox Name="txtFART" CharacterCasing="Upper" MinWidth="100" />
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=物料:}}" />
                                    <TextBox Name="txtMAT" CharacterCasing="Upper" MinWidth="100" />
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=供应商:}}" />
                                    <TextBox Name="txtSELLER"  CharacterCasing="Upper" MinWidth="50" />
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=UM:}}" />
                                    <TextBox Name="txtUM" CharacterCasing="Upper" MinWidth="50" />
                                    <Button x:Name="btnFilter" Click="btnFilter_Click" Content="{Binding Source={Localization:Translate Word=筛选}}"/>
                                    <Button x:Name="btnClear" Click="btnClear_Click" Content="{Binding Source={Localization:Translate Word=清空}}"/>
                                </WrapPanel>
                                <WrapPanel>
                                    <Button  Width="30" Height="30"  HorizontalAlignment="Left" Click="btnDelAllocation_Click">
                                        <Button.Background>
                                            <ImageBrush ImageSource="Images/Delete.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Text="屏蔽需求"></TextBlock>
                                    <TextBox Name="txtRDel">N</TextBox>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=主料已审核:}}" />
                                    <CheckBox Name="ChkPlanStatus" VerticalAlignment="Center" IsChecked="True" Background="White">
                                        <CheckBox.LayoutTransform>
                                            <ScaleTransform ScaleX="2" ScaleY="2" />
                                        </CheckBox.LayoutTransform>
                                    </CheckBox>
                                    <TextBlock Name="txtExtFactory" Width="200"  ></TextBlock>
                                    <TextBlock Name="txtMessage" Foreground="Red" Width="Auto" HorizontalAlignment="Left"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=加成比例}}" Width="Auto"  ></TextBlock>
                                    <TextBox Margin="10,0,0,0" Name="txtPlanRate" Width="30">0</TextBox>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=采购损耗}}" Width="Auto"  ></TextBlock>
                                    <TextBox  Margin="10,0,0,0" Name="txtWastageEK" Width="30">0</TextBox>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=采购量}}" Width="Auto" Visibility="Collapsed" ></TextBlock>
                                    <TextBox  Margin="10,0,0,0" Name="txtTmpEKME1" Width="100"  Visibility="Collapsed">0</TextBox>
                                </WrapPanel>
                            </StackPanel>
                            <DataGrid  x:Name="dlgXDECK"  Grid.Row="1"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwXDECK}}"  
                                       AutoGenerateColumns="False"
                                       EnableRowVirtualization="False"
                                       VerticalScrollBarVisibility="Auto"
                                       HorizontalScrollBarVisibility="Auto"
                                       VerticalAlignment="Stretch"
                                       HeadersVisibility="Column" 
                                       FontSize="14"
                                       IsReadOnly="True"
                                       HorizontalAlignment="Stretch"
                                       RowDetailsVisibilityMode="Visible">
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="5">
                                            <TextBlock Text="{Binding Source={Localization:Translate Word=状态:}}"></TextBlock>
                                            <TextBlock Foreground="Red" FontSize="12"                                       Text="{Binding Path=ABPSPGRD}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=ARTDES}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="14"                             
                            Text="{Binding Path=ABPART}"/>
                                            <TextBlock Foreground="Red" FontSize="14"                             
                            Text="("/>
                                            <TextBlock Foreground="Red" FontSize="14"                             
                            Text="{Binding Path=ABAVKAUFLFD}"/>
                                            <TextBlock Foreground="Red" FontSize="14"                             
                            Text=")"/>
                                            <TextBlock Foreground="CadetBlue" FontSize="16"     
                            Text="{Binding Path=CDES}"/>
                                            <TextBlock>:</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EXART}"/>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EXCOLOR}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=FSSZUSCHN}" Header="{Binding Source={Localization:Translate Word=类型}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=ART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=REQ}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=UM}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=SELLER}" Header="{Binding Source={Localization:Translate Word=供应商}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=SELLERNAME}" Width="120" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                        </Grid>
                    </Expander>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="100"></RowDefinition>
                            <RowDefinition Height="2*"></RowDefinition>
                            <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Row="0"  Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="1" >
                            <WrapPanel>
                                <Button  Width="30" Height="30"  IsEnabled="False" HorizontalAlignment="Left" Click="btnEKClear_Click">
                                    <Button.Background>
                                        <ImageBrush ImageSource="Images/undo.png" />
                                    </Button.Background>
                                </Button>
                                <TextBlock Text="重选"></TextBlock>
                                <Button  Width="30" Height="30"  IsEnabled="True" HorizontalAlignment="Left" Click="btnStockReplace_Click">
                                    <Button.Background>
                                        <ImageBrush ImageSource="Images/cut.png" />
                                    </Button.Background>
                                </Button>
                                <TextBox Name="txtStock" Width="80">0</TextBox>
                                <TextBox Background="White"  Margin="10,0,0,0"  Width="40"  
                                 Text="{Binding EKPMEEH, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                            </WrapPanel>
                            <DataGrid  x:Name="dlgEKPOS" 
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXEKPOS}}"  
                                           AutoGenerateColumns="False" EnableRowVirtualization="False"
                                           VerticalScrollBarVisibility="Auto"
                                           HorizontalScrollBarVisibility="Auto"
                                           MaxHeight="300"
                                           VerticalAlignment="Stretch"
                                           HeadersVisibility="Column" 
                                           FontSize="14"
                                           HorizontalAlignment="Stretch"
                                           EnableColumnVirtualization="True"
                               RowDetailsVisibilityMode="Visible">
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="5">
                                            <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=EKPART}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="CadetBlue" FontSize="16"                             
                            Text="{Binding Path=EKPFARBE}"/>
                                            <TextBlock>:</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSART}"/>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSFB}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=EKPQTYFREE}" Header="{Binding Source={Localization:Translate Word=可用}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPQTYLOCKED}" Header="{Binding Source={Localization:Translate Word=锁定}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPART}" Header="{Binding Source={Localization:Translate Word=品种}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPFARBE}" Header="{Binding Source={Localization:Translate Word=品种}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPME1}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=采购单}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header="" Width="Auto" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                            <DataGrid   
                                        Name="dlgTempEK"
                                        IsEnabled="False"
                                        Visibility="Hidden"
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTMPEKPOS}}"  
                                        AutoGenerateColumns="False" EnableRowVirtualization="False"
                                        VerticalScrollBarVisibility="Auto"
                                        HorizontalScrollBarVisibility="Auto"
                                        MaxHeight="300"
                                        HeadersVisibility="Column" 
                                        FontSize="14"
                                        HorizontalAlignment="Stretch"
                                        EnableColumnVirtualization="True"
                                    RowDetailsVisibilityMode="Visible">
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="5">
                                            <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=EKPART}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="CadetBlue" FontSize="16"                             
                            Text="{Binding Path=EKPFARBE}"/>
                                            <TextBlock>:</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSART}"/>
                                            <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSFB}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=EKPLIEFNR}" Header="{Binding Source={Localization:Translate Word=供应商}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPART}" Header="{Binding Source={Localization:Translate Word=品种}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPFARBE}" Header="{Binding Source={Localization:Translate Word=品种}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPME1}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPPRME, Converter={StaticResource ResourceKey=PreisConverter}}" Header="{Binding Source={Localization:Translate Word=价格}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=库存}}"></TextBlock>
                            <DataGrid  
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXSTOCK}}"  
                                        AutoGenerateColumns="False" EnableRowVirtualization="False"
                                        VerticalScrollBarVisibility="Auto"
                                        HorizontalScrollBarVisibility="Auto"
                                        Height="Auto"
                                        VerticalAlignment="Stretch"
                                        HeadersVisibility="Column" 
                                        FontSize="14"
                                        HorizontalAlignment="Stretch"
                                    MaxHeight="300"
                                        EnableColumnVirtualization="True">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=QTYFREE}" Header="{Binding Source={Localization:Translate Word=可用}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTY}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYLOCKED}" Header="{Binding Source={Localization:Translate Word=锁定}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=LO}" Header="{Binding Source={Localization:Translate Word=库}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=LB}" Header="{Binding Source={Localization:Translate Word=库区}}" Width="Auto" MinWidth="40" />
                                    <DataGridTextColumn Binding="{Binding Path=LOT}" Header="{Binding Source={Localization:Translate Word=批号}}" Width="Auto" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                        </StackPanel>
                        <StackPanel Grid.Row="0"  Grid.RowSpan="3" Grid.Column="1" >
                            <WrapPanel>
                                <Button Name="btnRefreshAllocation" Width="30" Height="30"  Click="btnRefreshAllocation_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/refresh.png" />
                                    </Button.Background>
                                </Button>
                                <StackPanel>
                                    <TextBlock FontSize="12" Text="{Binding Source={Localization:Translate Word=明细:左键关联，右键取消}}"></TextBlock>
                                    <TextBlock FontSize="12" Text="{Binding Source={Localization:Translate Word=手动更改数量，需要手动刷新。需要注意不能出现负数。}}"></TextBlock>
                                </StackPanel>
                            </WrapPanel>
                            <WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=计划}}"></TextBlock>
                                <TextBox Background="White"  FontStyle="Italic" FontSize="18"   Margin="10,0,0,0"  Width="80"  Name="txtReserved"
                                 />
                                <TextBlock Text="{Binding Source={Localization:Translate Word=分配}}"></TextBlock>
                                <TextBox Background="White"  FontStyle="Italic" FontSize="18"    Margin="10,0,0,0"  Width="80"  Name="txtAllocated"
                                 />
                            </WrapPanel>
                            <DataGrid  x:Name="dlgITXXDECK"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXXDECK}}"  
                               AutoGenerateColumns="False" EnableRowVirtualization="False"
                               VerticalScrollBarVisibility="Auto"
                               HorizontalScrollBarVisibility="Auto"
                               HeadersVisibility="Column" 
                               FontSize="12"
                               IsReadOnly="True"
                               MouseRightButtonUp="dlgITXDECK_MouseRightButtonUp"
                               MouseLeftButtonUp="dlgITXDECK_MouseLeftButtonUp"
                               EnableColumnVirtualization="False"   
                               MaxHeight="200"
                               RowDetailsVisibilityMode="Visible"
                               >
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                                            <TextBlock Foreground="Green" FontSize="12" Text="{Binding Path=ABAVKAUFKRS}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFLFD}"/>
                                            <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFPOS}"/>
                                            <TextBlock Text="来源"></TextBlock>
                                            <TextBlock Foreground="Red" FontSize="12" Text="{Binding Path=ABAAUFKRS}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFLFD}"/>
                                            <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFPOS}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <!--DataGridTextColumn Binding="{Binding Path=LSLIEFNA}" Header="{Binding Source={Localization:Translate Word=加工厂}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=计划}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABAQTYALLOCATE}" Header="{Binding Source={Localization:Translate Word=分配}}" Width="Auto" MinWidth="40" /-->
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                            <DataGrid  x:Name="dlgNCXDECK"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwNCXDECK}}"  
                               AutoGenerateColumns="False" EnableRowVirtualization="False"
                                                      MouseRightButtonUp="dlgITXNCDECK_MouseRightButtonUp"
                               MouseLeftButtonUp="dlgITXNCDECK_MouseLeftButtonUp"
                               HorizontalScrollBarVisibility="Auto"
                               HeadersVisibility="Column" 
                               FontSize="12"
                               IsReadOnly="True"
                               MaxHeight="200"
                               VerticalScrollBarVisibility="Auto"
                               EnableColumnVirtualization="False"     
                                   RowDetailsVisibilityMode="Visible"
                               >
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                                            <TextBlock Foreground="Green" FontSize="12" Text="{Binding Path=ABAVKAUFKRS}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFLFD}"/>
                                            <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFPOS}"/>
                                            <TextBlock Text="来源"></TextBlock>
                                            <TextBlock Foreground="Red" FontSize="12" Text="{Binding Path=ABAAUFKRS}"/>
                                            <TextBlock>/</TextBlock>
                                            <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFLFD}"/>
                                            <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFPOS}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <!--DataGridTextColumn Binding="{Binding Path=LSLIEFNA}" Header="{Binding Source={Localization:Translate Word=加工厂}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=计划}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABAQTYALLOCATE}" Header="{Binding Source={Localization:Translate Word=分配}}" Width="Auto" MinWidth="40" /-->
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="60" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="20" />
                                    <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                                </DataGrid.Columns>
                            </DataGrid>
                        </StackPanel>
                    </Grid>
                </DockPanel>
            </Grid>
        </TabItem>
        <TabItem Header="款式信息">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <WrapPanel Grid.Row="0" >
                    <TextBlock FontSize="14"   Width="Auto" Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=款式:}}" VerticalAlignment="Center" />
                    <WrapPanel>
                        <TextBlock Background="White"  FontSize="12"   Width="30" Name="txtKRS" Text="{Binding ABPAUFKRS, Source={ StaticResource ResourceKey=vwITXABPOS}}" />
                        <TextBlock Background="Wheat"  FontSize="12"  Width="60" Name="txtLFD" Text="{Binding ABPAUFLFD, Source={ StaticResource ResourceKey=vwITXABPOS}}" />
                    </WrapPanel>
                    <StackPanel>
                        <TextBox Background="Yellow"  FontSize="14"   Margin="15,0,0,0"  Width="120" Name="txtFS03" Text="{Binding ABPART, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        <TextBlock Background="White"  FontSize="14"   Margin="15,0,0,0"  Width="120" Text="{Binding FSABEZ, Converter={StaticResource ResourceKey=gb2312}, Source={ StaticResource ResourceKey=vwITXABPOS}}" />
                    </StackPanel>
                    <StackPanel>
                        <WrapPanel>
                            <TextBox Background="Pink"  FontSize="14"     Width="100" Name="txtFS03C" Text="{Binding ABPFARBE, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" Margin="10,0,0,0" />
                            <TextBox Background="Plum"  FontSize="14"   Margin="10,0,0,0"  Width="40"  Text="{Binding ABPGROE, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        </WrapPanel>
                        <TextBlock Background="White"  FontSize="14"   Margin="15,0,0,0"  Width="120" Text="{Binding FSFFBEZ, Converter={StaticResource ResourceKey=gb2312},  Source={ StaticResource ResourceKey=vwITXABPOS}}"/>
                    </StackPanel>
                    <StackPanel>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=数量}}"></TextBlock>
                            <TextBox Background="White"  FontSize="14"   Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding ABPSOLLMENGE7, Converter={StaticResource ResourceKey=d100}, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        </WrapPanel>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=交期}}"></TextBlock>
                            <TextBox Background="White"  FontSize="14"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding ABPLIEFDAT, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        </WrapPanel>
                    </StackPanel>
                    <StackPanel>
                        <Button  Width="30" Height="30"  Click="btnRefresh_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="/IntexReportClient;component/Images/Refresh.png" />
                            </Button.Background>
                        </Button>
                    </StackPanel>
                </WrapPanel>
                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Row="1" Grid.Column="0">
                        <DataGrid  x:Name="dlgAB05" 
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXABPOS}}"  
                                       AutoGenerateColumns="False" EnableRowVirtualization="False"
                                       VerticalScrollBarVisibility="Auto"
                                       HorizontalScrollBarVisibility="Auto" 
                                       VerticalAlignment="Stretch"
                                       HeadersVisibility="Column" 
                                       FontSize="14"
                                       Height="200"
                                       IsReadOnly="True"                               
                                       HorizontalAlignment="Stretch"
                                       EnableColumnVirtualization="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABPSPGRD}" Header="{Binding Source={Localization:Translate Word=状态}}" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header="{Binding Source={Localization:Translate Word=供应}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header="" Width="Auto" MinWidth="20" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                    <StackPanel Grid.Row="1" Grid.Column="1">
                        <DataGrid  x:Name="dlgAB15"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXAB15}}"  
                                       AutoGenerateColumns="False" EnableRowVirtualization="False"
                                       VerticalScrollBarVisibility="Auto"
                                       HorizontalScrollBarVisibility="Auto" 
                                       VerticalAlignment="Stretch"
                                       HeadersVisibility="Column" 
                                       FontSize="14"
                                       Height="200"
                                       IsReadOnly="True"
                                       HorizontalAlignment="Stretch"
                                       EnableColumnVirtualization="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABAART}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=计划}}" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAQTYALLOCATE}" Header="{Binding Source={Localization:Translate Word=分配}}" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}" Header="{Binding Source={Localization:Translate Word=供应}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS}" Header="" Width="Auto" MinWidth="20" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                </Grid>

            </Grid>
        </TabItem>
    </TabControl>
</local:DocumentBase>
